<?php
/**
 * Created by JetBrains PhpStorm.
 * User: MeRo
 * Date: 15.09.13
 * Time: 14:51
 * To change this template use File | Settings | File Templates.
 */

require_once 'templates/train/lib.php';
class newSurface extends renderElement
{
    public function __construct($contao) {
        $this->_contao = $contao;

        $this
            ->_initialRender()
            ->_render()
        ;
    }

    protected function _initialRender() {
        $this->_addElement('<form id="newSurfaceForm" action="" method="get" >
            <div id="errorlog"><ul></ul></div>
            <label for="surface_name">Landschaftsname:</label>
            <input type="text" maxlength="255" name="surface_name" value="' . post('surface_name') . '"/><br /><br /><br />

            <label for="surface_x_size">X-Gr&ouml;&szlig;e:</label>
            <input type="number" maxlength="4" name="surface_x_size" /><br /><br /><br />

            <label for="surface_y_size">Y-Gr&ouml;&szlig;e:</label>
            <input type="number" maxlength="4" name="surface_y_size" /><br /><br /><br />

            <label for="surface_public">Veröffentlichen:</label>
            <input type="checkbox" name="surface_public" value="1"><br /><br /><br />

            <label for="surface_description">Beschreibung:</label>
            <textarea name="surface_description" cols="30" rows="2"></textarea><br /><br /><br />
            <input type="hidden" name="FORM_SUBMIT" value="' . $this->_contao->formSubmit . '" />
            <input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}" />

            <input type="submit" value="Erstellen" />
        </form>');
        return $this;
    }
}

new newSurface($this);
